#ifndef COLLISION_H
#define COLLISION_H



#include "State Machine.h"
#include "CollisionStates.h"
#include "Character.h"
#include "Building.h"



// This class will be used by Characters to handle their collisions. It will record the characters involved in
// the collision (the Owner of the instance and the other character), the case of the collision (described bellow) 
// and the current state of the collision. (Unresolved, resolving, and resolved)




enum CollisionCase
{
	Case1,
	Case2,
	Case3,

	// Building Cases
	Case4
};

class Collision
{
public:
	bool operator==(const Collision aColl) 
	{
		return (aColl.m_Case == m_Case && aColl.m_pCollidingCharacter == m_pCollidingCharacter && aColl.m_pCollidingBuilding == m_pCollidingBuilding && aColl.m_pOwner == aColl.m_pOwner);
	}

	CollisionCase m_Case;
	StateMachine<Collision> m_CollisionState;

	Character* m_pOwner;

	// Both of these will not be used in the same instance. The one not being used will be set to null.
	Character* m_pCollidingCharacter;

	Building* m_pCollidingBuilding;

	bool resolved;
	CollisionCase Case() {return m_Case;}

	Collision(CollisionCase cCase, Character* Owner, Character* m_pCollidingCharacter);
	Collision(CollisionCase cCase, Character* Owner, Building*  m_pCollidingBuilding );
	Collision(Character* Owner);

 
};

#endif